/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rtsgame.core.view;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList;
import javax.swing.JPanel;

/**
 *
 * @author tom
 */
public class GamePanel extends JPanel {

  private ArrayList< PanelRepaintInteface > repaintObjects = new ArrayList<PanelRepaintInteface>();

  public GamePanel() {
      //setBackground(java.awt.SystemColor.controlShadow);
  }



  public void addPanelRepaint( PanelRepaintInteface item )
  {
    repaintObjects.add(item);
  }


  @Override
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    for( PanelRepaintInteface item : repaintObjects )
    {
      item.repaint( (Graphics2D) g);
    }

  }



}
